Current Location: Home> Function Categories> timezone_open

timezone_open

Alias ​​for DateTimeZone::__construct - Create a new DateTimeZone object
Name:timezone_open
Category:Date and time
Programming Language:php
One-line Description:Create a new DateTimeZone object.

Definition and usage

timezone_open() creates a new DateTimeZone object.

Example

Create a new DateTimeZone object and return the name of the time zone:

 <?php
$tz = timezone_open ( "Asia/Shanghai" ) ;
echo timezone_name_get ( $tz ) ;
?>

Try it yourself

grammar

 timezone_open ( timezone ) ;
parameter describe
timezone

Required. Specify time zone.

Tip: View a list of all time zones supported in PHP .

Similar Functions
Popular Articles